package com.nbgs.demo.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nbgs.demo.dao.WorkerMapper;
import com.nbgs.demo.model.Worker;
import com.nbgs.demo.service.WorkerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class WorkerServiceImpl implements WorkerService {
    @Autowired
    private WorkerMapper workerMapper;
    @Override
    public IPage<Worker> showSumWorker(Page<Worker> page,String workerName,String workerNum,String workerState) {
        return workerMapper.showSumWorker(page,workerName,workerNum,workerState);
    }

    @Override
    public int totalWorker(String workerName,String workerNum,String workerState) {

        return workerMapper.totalWorker(workerName, workerNum, workerState);
    }

    @Override
    public void addWorker(Worker worker) {
        workerMapper.addWorker(worker);
    }

    @Override
    public void updateWorker(Worker worker) {
        workerMapper.updateWorker(worker);
    }

    @Override
    public void addRoleAndRole(int workerId, String roleName) {
        workerMapper.addRoleAndRole(workerId,roleName);
    }
}
